Skip to content

Add generic project metadata detection and sync#5

Merged
guodong-sq merged 12 commits intomainfrom
expand-project-metadata-support
Feb 9, 2026
Merged

Add generic project metadata detection and sync#5
guodong-sq merged 12 commits intomainfrom
expand-project-metadata-support

Conversation

@guodong-sq
Copy link
Copy Markdown
Collaborator

@guodong-sq guodong-sq commented Jan 29, 2026

Summary

  • Expand metadata support beyond .ijwb to multiple IDE/editor patterns
  • Add interactive pattern detection and selection during install
  • Create generic wt-metadata-export and wt-metadata-import scripts

Changes

New Configuration

  • WT_METADATA_PATTERNS: Space-separated list of patterns to preserve
  • WT_KNOWN_METADATA: Array of 16 known patterns with descriptions

Supported Patterns

Category Patterns
JetBrains .idea, .run, .fleet
Bazel .ijwb, .aswb, .clwb, .bazelbsp, .bsp
Xcode/iOS .swiftpm, xcuserdata
VS Code .vscode
Scala .metals, .bloop
Eclipse .settings, .project, .classpath

New Scripts

  • bin/wt-metadata-export - Export all configured patterns to vault
  • bin/wt-metadata-import - Import all configured patterns to worktree

Install Flow

  1. Scan repo for existing metadata directories
  2. Show detected patterns with checkboxes (all selected by default)
  3. User can toggle with numbers, 'a' for all, 'n' for none
  4. Save selection to WT_METADATA_PATTERNS

Backward Compatibility

  • wt ijwb-export and wt ijwb-import kept as aliases
  • Existing .ijwb workflows continue to work

Test plan

  • Run ./install.sh and verify pattern detection works
  • Test with repos containing various metadata types
  • Verify wt add -b <branch> imports all selected patterns
  • Test legacy wt ijwb-export alias still works

🤖 Generated with Claude Code

guodong-sq and others added 4 commits January 29, 2026 12:04
Replace hardcoded java-monorepo defaults with a user-centric flow that:
  - Asks which repository to manage first
  - Auto-detects default branch from origin/HEAD or main/master
  - Derives all paths from repo location (e.g., myrepo -> myrepo-master, myrepo-worktrees)
  - Shows derived config and allows customization
Expand beyond .ijwb to support multiple IDE/editor metadata patterns:
- Add WT_METADATA_PATTERNS config variable (space-separated list)
- Add WT_KNOWN_METADATA array with 16 known patterns:
  - JetBrains: .idea, .run, .fleet
  - Bazel: .ijwb, .aswb, .clwb, .bazelbsp, .bsp
  - Xcode/iOS: .swiftpm, xcuserdata
  - VS Code: .vscode
  - Scala: .metals, .bloop
  - Eclipse: .settings, .project, .classpath

New scripts:
- bin/wt-metadata-export: Export all configured patterns to vault
- bin/wt-metadata-import: Import all configured patterns to worktree

Install flow changes:
- Scan repo for existing metadata directories
- Interactive checkbox selection (all detected selected by default)
- Save selection to WT_METADATA_PATTERNS

Updated:
- wt-add uses wt-metadata-import
- wt.sh adds metadata-export/import commands (keeps ijwb-* as aliases)
- All find commands use -L to follow symlinks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Detection now finds top-level metadata dirs only
  (e.g., .idea inside .ijwb is not listed separately)
- Export deduplicates by sorting paths and skipping nested ones
- Add tilde expansion for paths containing ~/

Algorithm: sort all found paths, keep only those not inside another kept path

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
These are replaced by wt-metadata-export and wt-metadata-import.
The 'wt ijwb-export' and 'wt ijwb-import' commands still work
as aliases pointing to the new metadata scripts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@guodong-sq guodong-sq force-pushed the update-install-script-and-remove-java-monorepo-specifics branch from 15c755c to 607bb31 Compare February 9, 2026 02:13
Base automatically changed from update-install-script-and-remove-java-monorepo-specifics to main February 9, 2026 02:14
guodong-sq and others added 8 commits February 8, 2026 21:19
Conflict resolution:
- bin/wt-ijwb-export, bin/wt-ijwb-import: Deleted (PR #5 replaces
  with generic wt-metadata-export/import)
- install.sh: Merged PR #4's ~/.wt/repos/<name>/ path scheme with
  PR #5's metadata detection and selection features

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update fallback path from ~/.config/wt/ to ~/.wt/ to match
PR #4's path scheme update.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix subshell variable scope bug in wt-metadata-import
  (pipe to while loop caused count variable to be lost; now uses
  process substitution)

- Rename wt-ijwb-refresh to wt-metadata-refresh
  - Now refreshes all Bazel IDE patterns (.ijwb, .aswb, .clwb) that
    are configured in WT_METADATA_PATTERNS, not just .ijwb
  - Updated all references in README.md and install.sh

- Update documentation to reflect generic metadata support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@guodong-sq guodong-sq marked this pull request as ready for review February 9, 2026 03:30
@guodong-sq guodong-sq merged commit a8fe71f into main Feb 9, 2026
1 check passed
@guodong-sq guodong-sq deleted the expand-project-metadata-support branch February 9, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant